package com.qf.mapper;/*
 *徐韬
 *2021/10/14
 *10:56
 */

import com.qf.entity.Student;
import org.apache.ibatis.annotations.*;

import java.util.List;

public interface StudentMapper {
    List<Student> selectStudentGrade();
    List<Student> selectStudentSubject();
    List<Student> showAll();
    Student selectById(Integer stuId);
    List<Student> selectByCondition(Student student);
    int updateStudent(Student student);
    int deleteById(Integer[] stuIds);
    @Select("select * from student")
    List<Student> select01();
    @Select("select * from student where stuId = #{stuId}")
    Student select02(Integer stuId);
    @Options(useGeneratedKeys = true,keyProperty = "stuId")
    @Insert("insert into student values(0,#{stuName},#{stuGender},#{stuPhone},#{bornDate},#{stuEmail},#{stuAddress},1)")
    int insert01(Student student);
    @Delete("delete from student where stuId = #{stuId}")
    int delete01(Integer stuId);
    @Update("update student set stuName = #{stuName},stuGender = #{stuGender},stuPhone = #{stuPhone},bornDate = #{bornDate},stuEmail = #{stuEmail},stuAddress = #{stuAddress},gradeId = 1 where stuId = #{stuId}")
    int update01(Student student);
}
